[id].vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation1></HomePageNavigation1>
  6. <!-- Banner1 -->
  7. <HomeBanner1></HomeBanner1>
  8. <!-- 面包屑导航 -->
  9. <div class="breadcrumb">
  10. <div class="inner">
  11. <span class="location">当前位置:</span>
  12. <el-breadcrumb :separator-icon="ArrowRight">
  13. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  14. <el-breadcrumb-item :to="{ path: `/primaryNavigation/${listid}` }" v-show="name">{{ name
  15. }}</el-breadcrumb-item>
  16. <el-breadcrumb-item>{{ newsDetail.con_title }}</el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. </div>
  20. <!-- 资讯列表 -->
  21. <div class="newsDetail">
  22. <div class="inner">
  23. <div class="innerLeft">
  24. <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
  25. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  26. </div>
  27. <div class="innerRight">
  28. <div class="rightMenuTitle">导航列表</div>
  29. <ul>
  30. <li v-for="(item, index) in bottomMenu" :key="index">
  31. <NuxtLink :to="`/speciaArticle/${item.id}`" target="_blank"
  32. v-if="item.id == pageId && item.id != 7" class="active">{{ item.name }}</NuxtLink>
  33. <NuxtLink :to="`/speciaArticle/${item.id}`" target="_blank"
  34. v-else-if="item.id != pageId && item.id != 7">{{ item.name }}</NuxtLink>
  35. <NuxtLink :to="`/specialList/${item.id}`" target="_blank"
  36. v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">{{
  37. item.name }}
  38. </NuxtLink>
  39. <NuxtLink :to="`/specialList/${item.id}`" target="_blank" v-else-if="item.id == 7">{{ item.name
  40. }}
  41. </NuxtLink>
  42. </li>
  43. </ul>
  44. </div>
  45. <div style="clear: both;"></div>
  46. </div>
  47. </div>
  48. <!-- 页面底部 -->
  49. <HomeFoot1></HomeFoot1>
  50. </template>
  51. <script setup>
  52. //1.页面依赖 start ---------------------------------------->
  53. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  54. import { ArrowRight } from '@element-plus/icons-vue'
  55. //获得跳转过来的id
  56. const route = useRoute();
  57. const articleId = route.params.id; //获得该页面的id
  58. const listid = route.query.listId; //获得该页面的id
  59. const name = route.query.listName; //获得该页面的id
  60. const pageId = route.params.id; //获得该页面的id
  61. const routeHref = route.href;
  62. //1.页面依赖 end ---------------------------------------->
  63. //2.页面数据 start ---------------------------------------->
  64. const newsDetail = ref({})
  65. const bottomMenu = ref([]);
  66. async function getPageData() {
  67. const { data: mkdata, error: mkdataError } = requestData('/web/getWebsiteFooterCategoryInfo', {
  68. method: 'GET',
  69. query: {
  70. 'fcat_id': articleId
  71. },
  72. });
  73. if (mkdataError.value) {
  74. //console.log()
  75. } else {
  76. if (mkdata.value) {
  77. newsDetail.value = mkdata.value.data;
  78. console.log(101010)
  79. console.log(newsDetail.value)
  80. }
  81. }
  82. }
  83. getPageData();
  84. async function getPageMenu() {
  85. const { data: mkdata, error: mkdataError } = requestData('/web/getWebsiteFooterCategory', {
  86. method: 'GET',
  87. query: {},
  88. });
  89. if (mkdataError.value) {
  90. //console.log()
  91. } else {
  92. if (mkdata.value) {
  93. bottomMenu.value = mkdata.value.data;
  94. }
  95. }
  96. }
  97. getPageMenu();
  98. //2.3 获得广告
  99. let adList = ref([]);
  100. const {data:adData,error:adError} = requestData('/web/getWebsiteFooterCategory',{method:'GET',query:{'ad_tag':'page'}});
  101. if (adError.value) {
  102. console.error('广告列表请求失败:', adError.value);
  103. } else {
  104. //当有值了以后再放进去,万恶之源,也是nuxt2和3都存在的一个问题,也许nuxt4会解决这个问题
  105. if (adData.value && adData.value.data) {
  106. adList.value = adData.value.data;
  107. console.log(adData.value.data)
  108. }
  109. }
  110. //2.页面数据 end ---------------------------------------->
  111. //4.设置seo信息 start---------------------------------------->
  112. //4.1 设置seo信息
  113. async function getSeo() {
  114. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  115. method: 'GET',
  116. query: {},
  117. });
  118. seoSetup(setData.data.website_head.title,setData.data.website_head.description,setData.data.website_head.keywords)
  119. }
  120. getSeo();
  121. //4.设置seo信息 end---------------------------------------->
  122. </script>
  123. <style lang="less" scoped>
  124. //导航条
  125. .breadcrumb {
  126. width: 100%;
  127. height: 22px;
  128. margin-bottom: 30px;
  129. font-family: Microsoft YaHei, Microsoft YaHei;
  130. font-weight: 400;
  131. font-size: 20px;
  132. color: #666666;
  133. line-height: 23px;
  134. text-align: left;
  135. font-style: normal;
  136. text-transform: none;
  137. .el-breadcrumb::v-deep {
  138. display: inline-block;
  139. vertical-align: -4px;
  140. }
  141. /deep/.el-breadcrumb__inner a,
  142. /deep/.el-breadcrumb__inner.is-link {
  143. color: #666666;
  144. font-weight: 400;
  145. text-decoration: none;
  146. transition: var(--el-transition-color);
  147. }
  148. span {
  149. font-family: Microsoft YaHei, Microsoft YaHei;
  150. font-weight: 400;
  151. font-size: 20px;
  152. color: #666666;
  153. line-height: 23px;
  154. text-align: left;
  155. font-style: normal;
  156. text-transform: none;
  157. }
  158. span:hover {
  159. color: #666666;
  160. }
  161. .location {
  162. margin-right: 20px;
  163. width: 100px;
  164. height: 22px;
  165. font-family: Microsoft YaHei, Microsoft YaHei;
  166. font-weight: 400;
  167. font-size: 20px;
  168. color: #666666;
  169. line-height: 23px;
  170. text-align: left;
  171. font-style: normal;
  172. text-transform: none;
  173. }
  174. }
  175. // 资讯列表
  176. .newsDetail {
  177. width: 100%;
  178. //height: 1400px;
  179. margin-bottom: 70px;
  180. .inner {
  181. width: 1200px;
  182. //height: 1400px;
  183. font-size: 16px;
  184. .innerLeft {
  185. //height: 1400px;
  186. float: right;
  187. .LeftTop {
  188. //height: 522px;
  189. margin-top: 50px;
  190. >h1 {
  191. line-height: 40px;
  192. margin-bottom: 30px;
  193. font-family: Microsoft YaHei, Microsoft YaHei;
  194. font-weight: bold;
  195. font-size: 30px;
  196. color: #333333;
  197. }
  198. >p {
  199. height: 18px;
  200. line-height: 18px;
  201. font-family: Microsoft YaHei, Microsoft YaHei;
  202. font-weight: 400;
  203. font-size: 14px;
  204. color: #999999;
  205. span {
  206. margin-right: 40px;
  207. }
  208. }
  209. >img {
  210. width: 680px;
  211. height: 382px;
  212. padding: 50px 0px 60px 55px;
  213. }
  214. }
  215. .leftBottomTitle {
  216. color: #028E21;
  217. font-size: 24px;
  218. font-weight: bold;
  219. height: 60px;
  220. line-height: 60px;
  221. }
  222. .leftBottom {
  223. width: 790px;
  224. font-size: 20px;
  225. border-top: 1px solid #139602;
  226. padding-top: 40px;
  227. >h3,
  228. >p {
  229. text-indent: 2em;
  230. width: 790px;
  231. font-family: Microsoft YaHei, Microsoft YaHei;
  232. font-size: 20px;
  233. color: #333333;
  234. line-height: 23px;
  235. padding-bottom: 30px;
  236. }
  237. >h3 {
  238. font-weight: 600px;
  239. }
  240. >p {
  241. font-weight: 400;
  242. }
  243. }
  244. }
  245. .innerRight {
  246. width: 279px;
  247. .rightMenuTitle {
  248. width: 279px;
  249. height: 69px;
  250. font-size: 22px;
  251. font-weight: bold;
  252. line-height: 58px;
  253. text-align: center;
  254. color: #fff;
  255. background: url("../../static/special/projectMoreTitle.png") no-repeat;
  256. margin-bottom: 30px;
  257. }
  258. ul {
  259. li {
  260. a {
  261. border-left: 5px solid #028E21;
  262. margin-bottom: 15px;
  263. font-size: 22px;
  264. display: block;
  265. height: 61px;
  266. line-height: 61px;
  267. color: #333333;
  268. text-align: center;
  269. background: #FBFBFB;
  270. }
  271. }
  272. }
  273. .active {
  274. border-left: 0;
  275. border: 1px solid #028E21;
  276. background: #fff;
  277. }
  278. }
  279. }
  280. }
  281. </style>